<?php

	// 신규
	if (empty($artist['idx'])) {
		$action_url = '/star/starunse/register';
	}
	// 수정
	else {
		$action_url = '/star/starunse/modify';
	}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Cache-Control" content="No-Cache">
	<meta http-equiv="Pragma" content="No-Cache">
	
	<title>운세의 신</title>

	<link rel="stylesheet" type="text/css" href="/css/common.css">
	
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			
			$("#frm").submit(function() {
				if ($("#artist_name").val() == '') {
					alert('이름을 입력하세요.');
					return false;
				} else if ($("#keyword").val() == '') {
					alert('키워드를 입력하세요.');
					return false;
				} else if ($("#birth_yyyy").val().length < 4) {
					alert('생년은 4자리로 입력하세요.');
					return false;
				} else if ($("#birth_mm").val().length < 2) {
					alert('생월은 2자리로 입력하세요.');
					return false;
				} else if ($("#birth_dd").val().length < 2) {
					alert('생일은 2자리로 입력하세요.');
					return false;
				} else if ($("#job").val() == '') {
					alert('직업을 입력하세요.');
					return false;
				} else if ($("#photo").val() == '') {
					alert('사진URL을 입력하세요.');
					return false;
				} else if ($("#body").val() == '') {
					alert('신체 사이즈를 입력하세요.');
					return false;
				}
			});
			
		});
	</script>
</head>
<body>
<div id="wrap">
	<!-- Contents -->
	<div>
		<h2>스타 상세 정보</h2>
	</div>
	<div>
		<form method="post" id="frm" action="<?=$action_url?>">
			<fieldset>
			<table width="100%" border="1" cellpadding="4" cellspacing="0">
				<tr>
					<td>idx</td>
					<td><input type="hidden" name="idx" value="<?=$artist['idx'];?>" /><?=$artist['idx'];?></td>
				</tr>
				<tr>
					<td>이름 *</td>
					<td><input type="text" name="artist_name" id="artist_name" value="<?=$artist['artist_name']?>" /></td>
				</tr>
				<tr>
					<td>검색어 *</td>
					<td><input type="text" name="keyword" id="keyword" value="<?=$artist['keyword']?>" size="70" /></td>
				</tr>
				<tr>
					<td>성별 *</td>
					<td>
						<input type="radio" name="sex" id="sex_m" value="남" <?=$artist['sex'] == '남' ? 'checked="checked"' : '' ?> />
						<label for="sex_m">남자</label>
						<input type="radio" name="sex" id="sex_f" value="여" <?=$artist['sex'] == '여' ? 'checked="checked"' : '' ?> />
						<label for="sex_f">여자</label>
					</td>
				</tr>
				<tr>
					<td>생년월일 *</td>
					<td>
						<input type="text" name="birth_yyyy" id="birth_yyyy" value="<?=$artist['birth_yyyy']?>" size="4" />년
						<input type="text" name="birth_mm" id="birth_mm" value="<?=$artist['birth_mm']?>" size="2" />월
						<input type="text" name="birth_dd" id="birth_dd" value="<?=$artist['birth_dd']?>" size="2" />일
					</td>
				</tr>
				<tr>
					<td>직업 *</td>
					<td><input type="text" name="job" id="job" value="<?=$artist['job']?>" /></td>
				</tr>
				<tr>
					<td>사진URL *</td>
					<td><input type="text" name="photo" id="photo" value="<?=$artist['photo']?>" size="70" /></td>
				</tr>
				<tr>
					<td>신체 *</td>
					<td><input type="text" name="body" id="body" value="<?=$artist['body']?>" /></td>
				</tr>
				<tr>
					<td>출생</td>
					<td><input type="text" name="birthday" id="birthday" value="<?=$artist['birthday']?>" /></td>
				</tr>
				<tr>
					<td>학력</td>
					<td><input type="text" name="achievement" id="achievement" value="<?=$artist['achievement']?>" size="70" /></td>
				</tr>
				<tr>
					<td>가족</td>
					<td><input type="text" name="family" id="family" value="<?=$artist['family']?>" size="70" /></td>
				</tr>
				<tr>
					<td>소속사</td>
					<td><input type="text" name="agency" id="agency" value="<?=$artist['agency']?>" size="70" /></td>
				</tr>
				<tr>
					<td>데뷔</td>
					<td><input type="text" name="debut" id="debut" value="<?=$artist['debut']?>" size="70" /></td>
				</tr>
				<tr>
					<td>수상</td>
					<td><input type="text" name="award" id="award" value="<?=$artist['award']?>" size="70" /></td>
				</tr>
				<tr>
					<td>경력</td>
					<td><input type="text" name="career" id="career" value="<?=$artist['career']?>" size="70" /></td>
				</tr>
				<tr>
					<td>홈페이지 타입</td>
					<td><input type="text" name="web_site_type" id="web_site_type" value="<?=$artist['web_site_type']?>" /></td>
				</tr>
				<tr>
					<td>홈페이지 URL</td>
					<td><input type="text" name="web_site_url" id="web_site_url" value="<?=$artist['web_site_url']?>" size="70" /></td>
				</tr>
			</table>
			</fieldset>
			<input type="submit" value="저장" />
		</form>
	</div>
	<!--// Contents -->
	
</div>
</body>
</html>